from sklearn.decomposition import PCA


def pca_demo():
    data = [[2, 8, 4, 5], [6, 3, 0, 8], [5, 4, 9, 1]]
    # 1.初始化PCA对象
    # transfer = PCA(n_components=0.95)
    transfer = PCA(n_components=3)
    # 2.调用fit_transform
    data = transfer.fit_transform(data)
    print(data)
    print(data.shape)

if __name__ == '__main__':
    pca_demo()